home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 45 / PC Gamer IT CD 45 2-2.iso / addons / photodraw / NT4SP4 / SP4I386.EXE / iivs.asp < prev    next >
Encoding:
Text File  |  1998-10-15  |  14.2 KB  |  535 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.  
  9.  
  10. <% 
  11. '    strings for localization
  12. Const L_ACCESSDENIED_TEXT="Access Denied" 
  13. Const L_ENTERINT_ERRORMESSAGE="Please enter an integer."
  14. Const L_UNSAVEDCHANGES_ERRORMESSAGE="You have unsaved changes. Save now?"
  15. Const L_VIRTUALSERVERID_TEXT="Web Site Identification"
  16. Const L_WORKINGSERVER_TEXT="Warning! You are changing a property on the site you are currently connected to, and may disable your remote session."
  17. Const L_MULTIBINDING_TEXT="This resource has multiple bindings"
  18. Const L_HOSTHEADER_TEXT="Host header name:"
  19. Const L_DESCRIPTION_TEXT="Description:"
  20. Const L_IPADDRESS_TEXT="IP address:"
  21. Const L_TCPPORT_TEXT="TCP port:"
  22. Const L_SSLPORT_TEXT="SSL port:"
  23. Const L_UNLIMITED_TEXT="Unlimited"
  24. Const L_LIMITTO_TEXT="Limit to:"
  25. Const L_CONNPARAMS_TEXT="Connection"
  26. Const L_MAXCON_TEXT="Maximum connections:"
  27. Const L_CONNTIMEOUT_TEXT="Connection timeout:"
  28. Const L_SECONDS_TEXT="seconds"
  29. Const L_ADVANCED_TEXT="Advanced..."
  30. Const L_ALLUNASSIGNED_TEXT="(All Unassigned)"
  31. Const L_CONNECTIONS_TEXT="connections"
  32. Const L_LOGGING_TEXT="Enable Logging"
  33. Const L_LOGFORMAT_TEXT="Active log format:"
  34. Const L_NONEINSTALLED_TEXT = " [No logging modules are currently installed] "
  35. Const L_EDIT_TEXT = "Properties..."
  36.  
  37. Const DEFAULTPORT = 80
  38. Const L_DEFAULTMAXCONNECTIONS_NUM = 1000
  39.  
  40. Const L_CHGBINDING_TEXT="WARNING!\r\rYou are modifying the bindings of the server you are currently connected to. Changing these bindings will result In you loosing connection to this site.\r\rAre you sure you want to continue?"
  41. Const L_SAVING_TEXT="Saving..."
  42.  
  43. 'On Error Resume Next 
  44.  
  45. Dim blanks,path,currentobj, ipport, ipaddress, readonly,i, multibind, oWebService
  46.  
  47. path=Session("spath")
  48. Session("path")=path
  49. Session("SpecObj")=path
  50. Session("SpecProps")="ServerBindings"
  51.  
  52. Set currentobj=GetObject(path)
  53.  
  54. blanks="" 
  55. for i=0 to 23
  56.     blanks=blanks & " "
  57. Next
  58.  
  59.  
  60. %>
  61.  
  62. <!--#include file="iiset.inc"-->
  63. <!--#include file="iibind.inc"-->
  64.  
  65. <% 
  66.  
  67.  
  68. function writeBinding(fieldname,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  69.  
  70.     On Error Resume Next 
  71.     
  72.     Dim aBinding, aSecBinding
  73.     Dim Binding
  74.     Dim SecBinding
  75.     
  76.     Dim host,ipport, ipaddress, secport, j
  77.  
  78.     aBinding=currentobj.ServerBindings
  79.  
  80.     if Session("vtype") = "svc" then
  81.         multibind = false
  82.         readonly = true
  83.         Binding=getBinding(aBinding(0))        
  84.     else
  85.     
  86.         if aBinding(0) <> "" then
  87.             'global readonly variable...
  88.             multibind=(UBound(aBinding)>0)
  89.             readonly = multibind
  90.             Binding=getBinding(aBinding(0))
  91.         else
  92.             readonly=false
  93.             aBinding(0)=":" & DEFAULTPORT & ":"
  94.             Binding=getBinding(aBinding(0))
  95.         end if
  96.     end if
  97.     
  98.         if fieldname="Host" then
  99.             host=Binding(2)
  100.             if readonly then
  101.                 if host="" then
  102.                     host="(none)"
  103.                 end if
  104.                 writeBinding=host 
  105.             else
  106.  
  107.                 writeBinding=inputbox(err,"hidden","hdnHost",host,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  108.             end if
  109.     
  110.         elseif fieldname="IPPort" then
  111.             ipport=Binding(1)
  112.             if readonly then
  113.                 if ipport="" then
  114.                     ipport=DEFAULTPORT
  115.                 end if            
  116.                 
  117.                 writeBinding=ipport
  118.             else            
  119.                 writeBinding=inputbox(err,"TEXT","hdnPort",ipport,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  120.             end if
  121.     
  122.         elseif fieldname="IPAddress" then
  123.             ipaddress=Binding(0)
  124.             if ipaddress="" then
  125.                 ipaddress=L_ALLUNASSIGNED_TEXT
  126.             end if            
  127.             if readonly then                                
  128.                 writeBinding=ipaddress
  129.             else
  130.                 writeBinding=inputbox(err,"TEXT","hdnIPA",ipaddress,fieldsize,onchangeproc,onfocusproc, onblurproc,True,adminonly,False)
  131.             end if
  132.     
  133.         elseif fieldname="SecureBinding" then
  134.             secPort=""
  135.             aSecBinding=currentobj.SecureBindings
  136.             if aSecBinding(0) <> "" then 
  137.             arraybound=UBound(aSecBinding)            
  138.             for j=0 to arraybound
  139.                 SecBinding=getBinding(aSecBinding(0))
  140.                 if SecBinding(0)=Binding(0) then
  141.                     secPort=SecBinding(1)
  142.                     exit for
  143.                 end if
  144.             Next
  145.             end if 
  146.  
  147.             if readonly then
  148.                 writeBinding=secPort 
  149.  
  150.             else
  151.                 writeBinding=inputbox(err,"TEXT","hdnSecBinding",secPort,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  152.             end if 
  153.     
  154.         end if
  155.  
  156.  
  157. end function
  158.  
  159.  
  160. function allBindings()
  161.     dim sBinding,sBindingList
  162.     for each sBinding in currentobj.ServerBindings
  163.         sBindingList = sBindingList & sBinding & ","
  164.     next
  165.     allBindings = sBindingList
  166. end function
  167.  
  168. function writeLogTypes(fieldname,value, id, adminonly)
  169.     On Error Resume Next 
  170.  
  171.     if id = currentobj.Get("LogPluginClsid") then
  172.         writeLogTypes="<OPTION SELECTED VALUE='" & id & "'>" & value
  173.     else
  174.         writeLogTypes="<OPTION VALUE='" & id & "'>" & value    
  175.     end if
  176. end function
  177.  
  178.  
  179.  %>
  180.  
  181.  
  182.  
  183. <html>
  184.  
  185. <head>
  186. <title></title>
  187. <script language="JavaScript">
  188.  
  189.     var Global=top.title.Global;
  190.  
  191.     Global.helpFileName="iipy";
  192.     Global.siteProperties = true;
  193.  
  194.     function warnWrkingSite()
  195.     {
  196.         if (top.title.nodeList[Global.selId].isWorkingServer)
  197.         {
  198.             alert("<%= L_WORKINGSERVER_TEXT %>");
  199.         }
  200.     }
  201.     
  202.     function SetBinding(){
  203.         
  204.         if (top.title.nodeList[top.title.Global.selId].isWorkingServer){
  205.             if (!confirm("<%= L_CHGBINDING_TEXT %>")){
  206.                 document.userform.hdnIPA.value=document.userform.hdnhdnIPA.value
  207.                 document.userform.hdnPort.value=document.userform.hdnhdnPort.value
  208.                 return;
  209.             }
  210.         }
  211.         if (document.userform.hdnIPA.value == "<%= L_ALLUNASSIGNED_TEXT%>"){
  212.             hdnIPA = "";
  213.         }
  214.         else{
  215.             hdnIPA = document.userform.hdnIPA.value;
  216.         }        
  217.         
  218.         document.userform.ServerBindings.value=hdnIPA + ":" + document.userform.hdnPort.value + ":" + document.userform.hdnHost.value; 
  219.         document.userform.hdnhdnIPA.value=hdnIPA;
  220.         document.userform.hdnhdnPort.value=document.userform.hdnPort.value;            
  221.         
  222.         if (hdnIPA == "")
  223.         {
  224.             document.userform.hdnIPA.value = "<%= L_ALLUNASSIGNED_TEXT%>";
  225.         }
  226.     }
  227.  
  228.     function isNum(txtcntrl,min,max) {
  229.         str=txtcntrl.value;
  230.     
  231.         for (var i=0; i < str.length; i++) {
  232.               num = parseInt(str.substring(i,i+1));
  233.             if (isNaN(num)){
  234.                alert("Please enter an integer.");
  235.                 return false;
  236.               }            
  237.          }
  238.         num = str;
  239.         
  240.         if (min != ""){    
  241.             if (num < min) {
  242.                 alert("Please enter an integer greater than " + (min-1) + ".");
  243.                 return false;
  244.             }
  245.         }
  246.         
  247.         if (max != ""){
  248.             if (num > max) {
  249.                 alert("Please enter an integer less than " + (max + 1) + ".");
  250.                 return false;
  251.             }        
  252.         }
  253.         return true;
  254.     }
  255.  
  256.     function SetMaxConn(){
  257.         curval=parseInt(document.userform.hdnMaxConnections.value);
  258.         if (document.userform.rdoMaxConnections[0].checked){
  259.             document.userform.MaxConnections.value=2000000000;    
  260.         }
  261.         else{    
  262.             document.userform.MaxConnections.value=document.userform.hdnMaxConnections.value;
  263.         }
  264.     }
  265.     
  266.     function setState(mState,mControl){
  267.         <% if Session("Browser") = "IE4" then %>
  268.             mControl.disabled = ! mState;
  269.         <% end if %>
  270.     }
  271.     
  272.     function setLogType(logCntrl,hdncntrl){
  273.         if (logCntrl.checked){
  274.             hdncntrl.value = 1;
  275.         }
  276.         else{
  277.             hdncntrl.value = 0;
  278.         }
  279.     }
  280.     
  281.     function setLogUIType(logCntrl){
  282.         
  283.         var logName = logCntrl.options[logCntrl.selectedIndex].text;
  284.  
  285.         var logType = "";
  286.         
  287.         if (logName.indexOf("Ext") > -1){
  288.             logType = "EXT";
  289.         }
  290.         if (logName.indexOf("ODBC") > -1) {
  291.             logType = "ODBC";
  292.         }
  293.  
  294.         top.connect.location.href = "iisess.asp?setLogUI=" + logType;        
  295.     }
  296.         
  297.     
  298.     function popBox(title, width, height, filename){
  299.         thefile=(filename + ".asp");
  300.         thefile="iipop.asp?pg="+thefile;
  301.         <% if Session("Browser") <> "IE3" then %>
  302.             width=width +25;
  303.             height=height + 50;                
  304.         <% end if %>
  305.  
  306.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  307.         if(popbox !=null){
  308.             if (popbox.opener==null){
  309.                 popbox.opener=self;
  310.             }
  311.         }
  312.     }
  313.  
  314.     
  315.  
  316. </script>
  317. </head>
  318.  
  319. <body bgcolor="#CCCCCC" topmargin="5" text="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;">
  320.  
  321. <FONT FACE="Helv,Arial" SIZE=1>
  322. <form name="userform">
  323. <b><%= L_VIRTUALSERVERID_TEXT %></b>
  324. <blockquote>
  325.  
  326. <table border="0" cellpadding="0">
  327. <tr>
  328.     <td valign="bottom">
  329.         <FONT FACE="Helv,Arial" SIZE=1>
  330.             <%= L_DESCRIPTION_TEXT %>
  331.         </font>
  332.     </td>
  333.     <td valign="bottom" colspan="2">
  334.         <FONT FACE="Helv,Arial" SIZE=1>
  335.             <%= text("ServerComment",25,"","","",false,false) %>
  336.         </font>
  337.     </td>
  338. </tr>
  339.  
  340. <tr>
  341.     <td valign="bottom"><FONT FACE="Helv,Arial" SIZE=1><%= L_IPADDRESS_TEXT %></font></td>
  342.     <td valign="bottom">
  343.         <FONT FACE="Helv,Arial" SIZE=1>
  344.             <%= writeBinding("IPAddress",15,"","","warnWrkingSite();SetBinding();",true,true) %>
  345.             <input type="hidden" name="ServerBindings" value="<%= allBindings() %>">
  346.         </font>
  347.     </td>
  348.         <td align="right" valign="bottom"><FONT FACE="Helv,Arial" SIZE=1>  
  349.             <% if Session("vtype") <> "svc" then %>
  350.             <% if Session("isAdmin") then %>
  351.                 <% if Session("FONTSIZE")="LARGE" then %>
  352.                     <input type="button" name="hdnAdvanced" value="<%= L_ADVANCED_TEXT %>" onclick="popBox('Advanced',595,375,'iimlti');">
  353.                 <% else %>
  354.                     <input type="button" name="hdnAdvanced" value="<%= L_ADVANCED_TEXT %>" onclick="popBox('Advanced',470,325,'iimlti');">
  355.                 <% end if %>                
  356.             <% end if %>
  357.             <% end if %>            
  358.         </font>
  359.     </td>
  360. </tr>
  361.  
  362. <tr>
  363.     <td valign="bottom"><FONT FACE="Helv,Arial" SIZE=1><%= L_TCPPORT_TEXT %></font></td>
  364.     <td valign="bottom">        
  365.         <FONT FACE="Helv,Arial" SIZE=1>
  366.             <%= writeBinding("IPPort",5,"","","warnWrkingSite();isNum(this,0,9999);SetBinding();",true,true) %>
  367.             <%= writeBinding("Host",5,"","","warnWrkingSite();SetBinding();",true,true) %>        
  368.         </font>
  369.     </td>
  370.  
  371. </tr>
  372.  
  373. <% if Session("isAdmin") then %>
  374.     <% if multibind then %>
  375.     <tr>
  376.         <td valign="bottom" colspan="4">
  377.         <FONT FACE="Helv,Arial" SIZE=1>
  378.         (<%= L_MULTIBINDING_TEXT %>)
  379.         </font>
  380.         </td>
  381.     </tr>
  382.     <% end if %>
  383. <% end if %>
  384.  
  385. </table>
  386.  
  387. </blockquote>
  388.  
  389. <hr>
  390. <FONT FACE="Helv,Arial" SIZE=1>
  391. <b><%= L_CONNPARAMS_TEXT %></b>
  392. <blockquote>
  393.  
  394. <table border="0" cellpadding="0">
  395. <tr>
  396.     <td colspan="2">
  397.         <FONT FACE="Helv,Arial" SIZE=1>
  398.             <%= printradio("MaxConnections", (currentobj.MaxConnections >=2000000000), "SetMaxConn();setState(!this.checked,document.userform.hdnMaxConnections);",true) %>
  399.             <%= L_UNLIMITED_TEXT %>
  400.         </font>
  401.     </td>
  402. </tr>
  403.  
  404.  
  405. <tr>    
  406.     <td valign="middle">
  407.         <FONT FACE="Helv,Arial" SIZE=1>
  408.             <%= printradio("MaxConnections", (currentobj.MaxConnections < 2000000000), "SetMaxConn();setState(this.checked,document.userform.hdnMaxConnections);",true) %>
  409.             <%= L_LIMITTO_TEXT %>
  410.             <input type="hidden" name="MaxConnections" value="<%= currentobj.MaxConnections %>">            
  411.  
  412.         </font>
  413.     </td>
  414.     <td valign="bottom">
  415.         <FONT FACE="Helv,Arial" SIZE=1>
  416.             <% if (currentobj.MaxConnections < 2000000000) then %>    
  417.                 <%= inputbox(0,"TEXT","hdnMaxConnections",currentobj.MaxConnections,10,"","", "isNum(this,1,2000000001);SetMaxConn();",false,True,False) %>
  418.             <% else %>
  419.  
  420.                 <%= inputbox(0,"TEXT","hdnMaxConnections",L_DEFAULTMAXCONNECTIONS_NUM,10,"","", "isNum(this,1,2000000001);SetMaxConn();",false,True,False) %>
  421.             <% end if %>                                
  422.     </td>
  423.     <td valign="middle">
  424.         <FONT FACE="Helv,Arial" SIZE=1>        
  425.                  <%= L_CONNECTIONS_TEXT %>
  426.         </font>    
  427.     </td>
  428. </tr>
  429. <tr>
  430.     <td>  </td>
  431. </tr>
  432.  
  433. <tr>
  434.     <td valign="middle"><FONT FACE="Helv,Arial" SIZE=1><%= L_CONNTIMEOUT_TEXT %>  </font></td>
  435.     <td valign="bottom">
  436.             <%= text("ConnectionTimeout",10,"","", "isNum(this,1,2147483646);",True,True) %>
  437.     </td>
  438.     <td valign="middle">
  439.         <FONT FACE="Helv,Arial" SIZE=1>
  440.          <%= L_SECONDS_TEXT %>
  441.         </font>
  442.     </td>
  443. </tr>
  444.  
  445. <tr>
  446.     <td colspan="2" height="4"></td>
  447. </tr>
  448.  
  449. </table>
  450.  
  451. </blockquote>
  452. </font>
  453.  
  454.  
  455. <hr>
  456. <FONT FACE="Helv,Arial" SIZE=1>
  457.  
  458. <%
  459. On Error Resume Next
  460. Dim LoggingModules,noLogging, Module, InfoNode, AvailMods
  461.  
  462. Set LoggingModules = GetObject("IIS://localhost/logging")
  463. Set InfoNode = GetObject("IIS://localhost/W3SVC/Info")
  464. AvailMods = InfoNode.LogModuleList
  465. if err <> 0 then
  466.     noLogging = True
  467. end if
  468.                 
  469. %>
  470. <% if noLogging then %>
  471.     <img align="top" src="images/checkoff.gif" width="13" height="13">
  472. <% else %>
  473.     <% if currentobj.LogType = 1 then %>
  474.         <INPUT TYPE="checkbox" NAME="hdnLogType" checked OnClick = "setLogType(this,document.userform.LogType);setState(this.checked,document.userform.hdnBtnLogProps);setState(this.checked,document.userform.LogPlugInClsid);top.title.Global.updated=true;">
  475.     <% else %>
  476.         <INPUT TYPE="checkbox" NAME="hdnLogType" OnClick = "setLogType(this,document.userform.LogType);setState(this.checked,document.userform.hdnBtnLogProps);setState(this.checked,document.userform.LogPlugInClsid);top.title.Global.updated=true;">    
  477.     <% end if %>
  478.     <INPUT TYPE="hidden" NAME="LogType" VALUE="<%= currentobj.LogType %>">
  479. <% end if %>
  480. <%= L_LOGGING_TEXT %>
  481.  
  482. <blockquote>
  483.  
  484. <table border="0" cellpadding="0">
  485. <tr>
  486.     <td colspan="1">
  487.         <FONT FACE="Helv,Arial" SIZE=1>        
  488.             <%= L_LOGFORMAT_TEXT %>
  489.             <select size="1" name="LogPlugInClsid" onchange="setLogUIType(this);">            
  490.                 <%
  491.                 
  492.                     if noLogging then
  493.                         Response.write "<OPTION>" & L_NONEINSTALLED_TEXT & "</OPTION>"                            
  494.                     else
  495.                         For Each Module in LoggingModules
  496.                             If InStr(AvailMods, Module.Name) Then
  497.                                 Response.write writeLogTypes("LogPluginClsid", Module.Name, Module.LogModuleId,false)                         
  498.                             End If
  499.                         Next
  500.                     end if
  501.                 %>
  502.             </select>
  503.         </font>
  504.     </td>
  505.     <td><FONT FACE="Helv,Arial" SIZE=1>
  506.     <% if not noLogging then %>
  507.         <% if Session("FONTSIZE") = "LARGE" then %>
  508.         <input type="button" name="hdnBtnLogProps" value="<%= L_EDIT_TEXT %>" onclick="popBox('LogDetail',450,400,'iilog');">
  509.         <% else %>
  510.         <input type="button" name="hdnBtnLogProps" value="<%= L_EDIT_TEXT %>" onclick="popBox('LogDetail',400,400,'iilog');">        
  511.         <% end if %>
  512.     <% end if %>
  513.     </FONT>
  514.     </td>
  515. </tr>
  516.  
  517. </table>
  518.  
  519. </blockquote>
  520. </form>
  521. </font>
  522. <% if not noLogging then %>
  523. <script language="JavaScript">
  524.     setState(document.userform.rdoMaxConnections[1].checked,document.userform.hdnMaxConnections);
  525.     setState(document.userform.hdnLogType.checked,document.userform.LogPlugInClsid);
  526.     setState(document.userform.hdnLogType.checked,document.userform.hdnBtnLogProps)
  527.     setLogUIType(document.userform.LogPlugInClsid)
  528. </script>
  529. <% end if %>
  530. </body>
  531. </html>
  532.  
  533.  
  534. <% end if %>
  535.